// migrations 创建表 npx sequelize migration:generate --name=init-menu

export default (app) => {
  const { STRING, INTEGER } = app.Sequelize

  const Menu = app.model.define('menu', {
    id: { type: STRING, primaryKey: true },
    parent: INTEGER(5),
    path: STRING(200),
    title: STRING(200),
    icon: STRING(200),
    order: INTEGER(5),
    category: STRING(11),
  },
  {
    timestamps: false, // 关闭 egg 默认startAt
    tableName: 'menus',
  },
  )

  return Menu
}